package com.leizi.igym.BaseContext;

import com.leizi.igym.domain.User;
import com.leizi.igym.pojo.ContextUser;

/**
 * @Author: leizi0110
 * @CreateTime: 2024-04-02  18:03
 * @Description:
 */

public class UserThreadLocal {
    private static final ThreadLocal<ContextUser> LOCAL_CONTEXT = new ThreadLocal<>();

    public static void set(ContextUser user) {
        LOCAL_CONTEXT.set(user);
    }

    public static ContextUser get(){
       return LOCAL_CONTEXT.get();
    }

    public static void remove(){
        LOCAL_CONTEXT.remove();
    }
}
